Utility task using lambda functions to submit work. More...
Public Member Functions | |
LambdaTask () | |
~LambdaTask () | |
virtual TASK_RESULT | onWork () override |
virtual void | onWorkDone () override |
virtual void | onSuccess () override |
virtual void | onFail () override |
virtual void | onAbort () override |
void | setWorkFunc (std::function< TASK_RESULT()> func) |
void | setWorkDoneFunc (std::function< void()> func) |
void | setSuccessFunc (std::function< void()> func) |
void | setFailFunc (std::function< void()> func) |
void | setAbortFunc (std::function< void()> func) |
![]() | |
Task () | |
virtual | ~Task () |
Thread * | getParentThread () const |
TASK_RESULT | getWorkResult () const |
void | setParentThread (Thread *thread) |
void | setWorkResult (TASK_RESULT result) |
Utility task using lambda functions to submit work.
nkTasks::LambdaTask::LambdaTask | ( | ) |
Constructor.
nkTasks::LambdaTask::~LambdaTask | ( | ) |
Destructor.
|
overridevirtual |
See nkTasks::Task::onWork(). Reimplemented for this class to work.
Implements nkTasks::Task.
|
overridevirtual |
See nkTasks::Task::onWorkDone(). Reimplemented for this class to work.
Implements nkTasks::Task.
|
overridevirtual |
See nkTasks::Task::onSuccess(). Reimplemented for this class to work.
Implements nkTasks::Task.
|
overridevirtual |
See nkTasks::Task::onFail(). Reimplemented for this class to work.
Implements nkTasks::Task.
|
overridevirtual |
See nkTasks::Task::onAbort(). Reimplemented for this class to work.
Implements nkTasks::Task.
void nkTasks::LambdaTask::setWorkFunc | ( | std::function< TASK_RESULT()> | func | ) |
Allows to set the function executed by onWork().
void nkTasks::LambdaTask::setWorkDoneFunc | ( | std::function< void()> | func | ) |
Allows to set the function executed by onWorkDone().
void nkTasks::LambdaTask::setSuccessFunc | ( | std::function< void()> | func | ) |
Allows to set the function executed by onSuccess().
void nkTasks::LambdaTask::setFailFunc | ( | std::function< void()> | func | ) |
Allows to set the function executed by onFail().
void nkTasks::LambdaTask::setAbortFunc | ( | std::function< void()> | func | ) |
Allows to set the function executed by onAbort().